import java.util.Arrays;
import java.util.Scanner;

//和为 s 的两个数字
//输入一个 递增 排列的数组和一个数字s,在数组中查找两个数,使得它们的和正好是s.
//如果有多对数字的和等于s,则输出任意一对即可
//定义双指针,利用单调性
public class test6 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int count = in.nextInt();//元素个数
        int number = in.nextInt();//查找元素
        int[] nums = new int[count];
        for (int i = 0; i < count; i++) {
            nums[i] = in.nextInt();
        }
        Arrays.sort(nums);
        getResult(nums,number);
    }
    public static void getResult(int[] nums,int number){
        int left = 0,right = nums.length-1,sum=0;
        while (left<right){
            sum = nums[left]+nums[right];
            if(sum<number)
                left++;
            else if (sum>number) {
                right--;
            }else
                break;
        }
        System.out.println(nums[left]+" "+nums[right]);
    }
}
